# -*- coding:utf-8 -*-
import os
from pylib import utils

__author__ = 'lu'


def clone(url, path):
    os.system('git clone %s %s' % (url, path))


def branch(b):
    os.system('git fetch')
    os.system('git checkout %s --force' % b)


def pull(repo, b):
    os.system('git fetch')
    os.system('git pull %s %s' % (repo, b))
    return utils.execCmd('git rev-list HEAD -n 1')
